package com.qys.livesMall.shop.controller.sys;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qys.livesMall.common.result.R;
import com.qys.livesMall.shop.mapper.ShopOrderInfoMapper;
import com.qys.livesMall.shop.modal.dto.ShopAnchorOrderDto;
import com.qys.livesMall.shop.modal.query.QueryShopAnchorOrderDto;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @packageName:
 * @className:SysShopAnchorOrderController
 * @Description:
 * @author:guomx
 * @date:2023/7/114:22
 */
@RestController
@RequestMapping("/sys/shopAnchor")
@Tag(name = "主播带货",description = "主播带货")
public class SysShopAnchorOrderController {

    @Resource
    private ShopOrderInfoMapper infoMapper;

    @Operation(summary = "主播带货列表")
    @PostMapping("/page")
    public R<Page<ShopAnchorOrderDto>> list(@RequestBody QueryShopAnchorOrderDto data){
        Page<ShopAnchorOrderDto> page = Page.of(data.getCurrent(), data.getSize());
        Page<ShopAnchorOrderDto> list = infoMapper.queryOrderSkuWithAnchorInfo(page, data);
        return R.ok(list);
    }

}
